From 42f9af13dac7221590f3ba5bf080b5705dd30cfb Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 12 Jun 2003 20:17:37 +0000 Subject: [PATCH] Fix le_read64 to not actually be le_read56. Easygps: use it when writing coords. --- gpsbabel/easygps.c | 7 +++++-- gpsbabel/util.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gpsbabel/easygps.c b/gpsbabel/easygps.c index c9d5ad333..efc67172e 100644 --- a/gpsbabel/easygps.c +++ b/gpsbabel/easygps.c @@ -211,6 +211,7 @@ write_pstring(const char *p) static void ez_disp(const waypoint *wpt) { + char tbuf[8]; fprintf(file_out, "W", 0xb); if (wpt->shortname) { fputc(1, file_out); @@ -225,9 +226,11 @@ ez_disp(const waypoint *wpt) write_pstring(wpt->icon_descr); } fputc(0x63, file_out); - fwrite(&wpt->position.latitude.degrees, 8, 1, file_out); + le_read64(tbuf, &wpt->position.latitude.degrees); + fwrite(tbuf, 8, 1, file_out); fputc(0x64, file_out); - fwrite(&wpt->position.longitude.degrees, 8, 1, file_out); + le_read64(tbuf, &wpt->position.longitude.degrees); + fwrite(tbuf, 8, 1, file_out); if (wpt->notes) { fputc(5, file_out); write_pstring(wpt->notes); diff --git a/gpsbabel/util.c b/gpsbabel/util.c index 06656b4e0..964d34376 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -332,7 +332,7 @@ le_read64(void *dest, void *src) memcpy(dest, src, 8); } else { int i; - for (i = 0; i < 7; i++) { + for (i = 0; i < 8; i++) { cdest[i] = csrc[7-i]; } } -- 2.30.2